﻿CREATE PROCEDURE [dbo].[Hogar_Agente_ObtenerPorDni] 
 @Dni VARCHAR(10)  
AS 
BEGIN

/*****************************************************************************************************************************************/
-- Author: Carlos Mendoza
-- Purpose:   obtener un agente por su dni
-- Returns:    Agente
/*****************************************************************************************************************************************/ 
	
	SELECT  [AgenteId],
			[Dni],
			[Nombre],
			[Apellido],
			[Telefono],
			[Domicilio],
			[FechaBaja],
			[AreaId],
			[CargoId],
			[PuestoId],
			CASE WHEN [Activo] = 1 THEN 1 ELSE 0 END AS [Activo]
	FROM	[dbo].[Agente] ag WITH (NOLOCK)
	WHERE [Dni] = @Dni AND [Activo] = 1
	
END